package com.qf.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.entity.KuCunUser;
import com.qf.service.KuCunUserService;
import com.qf.until.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * --- 木叶飞舞之处，火之意志生生不息---
 *
 * @author
 * @date 2024/7/26
 * @desc
 */
@RestController
@RequestMapping("/wms/kuCun")
public class KuCunUserController {
    @Autowired
    private KuCunUserService kuCunUserService;

    /**
     * 库存查询获得全部数据
    * */
    @GetMapping("/KfindAll")
    public R KfindAll(@RequestParam HashMap<String, String> map) {
        int pageNum = Integer.parseInt(map.get("pageNum"));
        int pageSize = Integer.parseInt(map.get("pageSize"));
        PageHelper.startPage(pageNum, pageSize);
        List<KuCunUser> list = kuCunUserService.KfindAll(map);
        PageInfo<KuCunUser> info = new PageInfo<>(list);
        System.out.println("数据"+info);
        return R.ok(info);
    }
}
